function run(db, sql){
	return new Promise((resolve, reject) => {
		db.run(sql, [], function(err){
			if(err) reject(err.message);
			else resolve(this.lastID);
		})
	})
}

function query(db, sql) {
	return new Promise((resolve, reject) => {
		db.all(sql, [], function(err, rows){
			if(err) reject(err.message);
			else resolve(rows)
		})
	})
}


module.exports = {run, query};